import { useCallback, useEffect } from 'react';
// import { getFrameImage } from '../utils/videoBase';
import type { DrawPalette } from '../microPalette/DrawPalette';
import { VIDEO_FIRST_FRAME_BASE64 } from '../microPalette/mockData/firstFrameImgBase64';
const useLoadOriginPicureEffect = (drawPaletteInstance: DrawPalette | null) => {
  const initOriginPictureInfo = useCallback(async () => {
    if (!drawPaletteInstance) return;
    // const url = await getFrameImage(videoSource, 0, 'base64');
    drawPaletteInstance.initOriginPictureInfo({
      url: VIDEO_FIRST_FRAME_BASE64,
    });
  }, [drawPaletteInstance]);

  useEffect(() => {
    if (!drawPaletteInstance) return;
    initOriginPictureInfo();
  }, [drawPaletteInstance, initOriginPictureInfo]);
};
export { useLoadOriginPicureEffect };
